package com.lottery.game.core.modules.mapper;

import com.lottery.game.core.modules.entity.user.GameUser;
import com.lottery.game.core.modules.entity.user.TokenEntity;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 游戏用户DAO接口
 *
 * @author chenye
 * @version 2018-0606
 */
public interface GameUserDao {
    Integer queryUserCount(@Param("username") String username, @Param("phone") String phone);

    int insertUser(GameUser gameuser);

    /**
     * 查询是否含有该名称的机器
     *
     * @param robotName
     * @return
     */
    Integer queryRobotManageCountByName(@Param("robotName") String robotName);

    Map<String, Object> pwdLogin(Map<String, Object> m);

    //通过用户名密码获取用户
    GameUser getGameUserBynamepwd(@Param("username") String username,
                                  @Param("password") String password);

    //通过用户名获取用户
    GameUser getGameUserByUserName(@Param("username") String username);

    /*
     * 通过用户名得到盐
     */
    String getSaltByUsername(String username);

    //获取用户列表数据
    Map<String, Object> getGameUserListdata(Map<String, Object> map);

    //获取用户列表级别信息
    Map<String, Object> getGameUserLevel(Map<String, Object> map);

    //获取用户数量
    Integer getGameUserListdataCount(Map<String, Object> map);

    /**
     * 根据编号查找用户Id
     *
     * @param gameusernumber 排序编号
     * @return
     */
    String queryUserIdByNo(String gameusernumber);


    void insertAccessToken(TokenEntity entity);

    Integer queryAccessTokenByClientId(@Param("clientId") String clientId);

    Integer queryAccessTokenByToken(@Param("accessToken") String accessToken);

    void updateAccessToken(TokenEntity entity);

    GameUser getUserByPhone(@Param("phone") String phone);

    GameUser get(String id);

    int updatePwd(Map<String, String> map);

    int updatePayPwd(Map<String, String> map);

    int updatePhotoAddress(Map<String, String> map);

    int updateNewPwd(Map<String, String> map);

    Map<String, Object> getGameUserpwd(Map<String, Object> map);

    Map<String, Object> getGameUserPayPwd(Map<String, Object> map);

    void updateGameBalance(GameUser gameUser);

    int updateUserStatus(Map<String, String> map); //禁言

    int udpatefenghaostatus(Map<String, String> map);//封账号或者IP

    int updateLoginIp(Map<String, String> map); //修改登录IP和地址

    int updateUserOnlineStatus(Map<String, String> map);//修改用户的在线状态

    int updateBatchUserOnlineStatus(List<Map<String, Object>> list);//修改用户的在线状态

    Map<String, Object> regNewPayPwd(Map<String, String> map); //验证支付密码
}
